<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <meta charset="UTF-8">
    <title>搜索</title>
    <link rel="stylesheet" href="${ctx}/static/styles/result.css" type="text/css">
</head>
<body>
<div class="main">
    <div class="container row">
        <div class="search-result col-lg-8">
            <h2 class="search-title">搜索结果<span class="search-result-count">本次共搜索到${total}条结果</span></h2>
            <!--<h3 class="search-result-count"></h3>-->
            <ul class="search-result-list">
                <c:forEach items="${docs.content}" var="doc">
                    <li class="search-result-item">
                        <a href="${ctx}/doc/detail/${doc.id}" class="search-result-more pull-right">
                            查看详情
                        </a>
                        <div class="search-result-detail">
                            <div class="search-result-detail-title">
                                <a href="${ctx}/doc/detail/${doc.id}">${doc.title}</a>
                            </div>
                            <div class="search-result-detail-abs">
                            </div>
                            <a class="btn btn-success" onclick="addWriteDoc('${doc.id}')">加入编研</a>
                        </div>
                    </li>
                </c:forEach>
            </ul>
            <a style="margin-top: 10px;" class="btn btn-danger" href="${ctx}/doc/writeDoc">编研文档</a>
            <tags:pagination_solr_simple page="${docs}" paginationSize="10"/>
        </div>
        <%--<div class="knowledge-graph col-lg-4">--%>
            <%--<h2 class="search-title">知识图谱</h2>--%>
            <%--<!--<img src="img/kg1.jpg">--%>
            <%--<img src="img/kg2.jpg">--%>
            <%--<img src="img/kg3.jpg">--%>
            <%--<img src="img/kg4.jpg">--%>
            <%---->--%>
            <%--<p>此类信息暂无知识图谱数据</p>--%>
        <%--</div>--%>
    </div>
</div>
<script>
    function addWriteDoc(data) {
        var docId = data
        $.ajax({
            type: "get",
            url: "${ctx}/doc/addUpdateDoc/" + data,
            success: function () {
                alert("加入成功！")
            }
        });
    }
</script>
</body>
</html>